import service from '@/request';

const request = (url,data,type) => {
  if (process.env.NODE_ENV == 'development') {
    url = "/api" + url;
  } else if (process.env.NODE_ENV == 'debug') {

  } else if (process.env.NODE_ENV == 'production') {
    // url = "window.location.orgin" + url;
    url = 'http://tj.beizeng.net' + url;
  }
  return service({
    method: type || 'post',
    url: url,
    data: data || {}
  });
};
export const getPlatfromList = (params) => {
  return request('/platform/findAllPlatform',{},'get');
};

//nettraffic page api address
export const getNettrafficData = (params) => {
  return request('/casFlow/findFlowParentList',params);
};
export const getNettrafficChild = (params) => {
  return request('/casFlow/findFlowChildList',params);
};

export const getUvTimesTableData = (params) => {
   return request('/casFlow/queryCookieNumListByDate',params);
};
export const getUvTimesTableDataOfHours = (params) => {
  return request('/casFlow/queryCookieNumListByHour',params);
};
export const getUvDaysTableData = (params) => {
  return request('/casFlow/queryCookieDayListByDate',params);
};
export const getUvDaysTableDataOfHour = (params) => {
  return request('/casFlow/queryCookieDayListByHour',params);
};

//salesAls page api address
export const saleAlsApi = (params) => {
   // return request('/discountReason/selectDiscountReasonAnalysis',params);
  return request('/discountReason/selectDiscountReasonDayAnalysis',params);
};

export const saleAlsApiLoadChild = (params) => {
  return request('/discountReason/selectDiscountReasonHourAnalysis',params);
};

